/* Fix some styles with the angular-ui-select bootstrap theme that isn't right when combined with all of our styles */

// ensure ui-select dropdown overlays when appended to body
body > .ui-select-bootstrap.open {
  z-index: @zindex-modal;
}
.ui-select-bootstrap {
  .ui-select-choices-row {
    > span {
      border-color: transparent;
      border-style: solid;
      border-width: 1px 0;
      line-height: @line-height-base;
      padding: 1px 10px;
      &:hover,
      &:focus {
        background-color: @dropdown-link-hover-bg;
        border-color: @dropdown-link-hover-border-color;
        color: @dropdown-link-hover-color;
      }
    }
    &.active {
      > span {
        background-color: @dropdown-link-active-bg !important;
        border-color: @dropdown-link-active-border-color !important;
        color: @dropdown-link-active-color;
      }
      .text-muted {
        color: #f5f5f5;
      }
    }
  }
  .ui-select-choices-row-inner {
    min-height: 24px;
    cursor: pointer;
  }
  .ui-select-choices-group-label:empty {
    // Prevent extra space above the first choice when the group label is empty.
    padding: 0;
  }
  .ui-select-match-text, .ui-select-placeholder {
    font-weight: normal;
    padding-right: 20px;
  }
  .ui-select-match-text span {
    display: block;
    text-overflow: ellipsis;
    span {
      display: inline;
    }
  }
  .ui-select-placeholder {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
  }
  .ui-select-toggle > .caret {
    font-style: normal;
    right: 6px;
    top: 10px;
    // Workaround for https://github.com/angular-ui/ui-select/issues/224
    // A runtime error occurs when you click exactly on the down caret for some
    // selects, such as the strategy type select in the deployment config editor.
    pointer-events: none;
  }
  /* Fixes ui-select's input box extending to 100% page width if the page has been resized after page-load
  * https://github.com/angular-ui/ui-select/issues/1678
  */
  .ui-select-search {
    width: 100% !important;
  }
}
